home *** CD-ROM | disk | FTP | other *** search
- /*
- * FILE
- * freeclop.c
- *
- * DESCRIPTION
- * This function will release all memory allocated by the
- * clop() function.
- *
- * AUTHOR
- * Anders 'ALi' Lindgren
- * Mälarblick 8
- * S-161 51 Bromma
- * Sweden
- */
-
- #include "stdlib.h"
-
- #include "clop.h"
-
- void __stdargs
- freeclop(struct clop_array * clop_array)
- {
- register int i;
-
- for (i=0; clop_array[i].type != CLOPT_END; i++) {
- if (clop_array[i].type == CLOPT_STRING) {
- if(clop_array[i].outflags & CLOPOF_ALLOCATED) {
- free(clop_array[i].value.string);
- clop_array[i].outflags &= ~CLOPOF_ALLOCATED;
- }
- clop_array[i].value.string = NULL;
- }
- }
- return;
- }
-